Coherence de-coupling buffer

ABSTRACT

A coherence decoupling buffer. In accordance with a first embodiment of the present invention, a coherence decoupling buffer is for storing tag information of cache lines evicted from a plurality of cache memories. A coherence decoupling buffer may be free of value information of the plurality of cache memories. A coherence decoupling buffer may also be combined with a coherence memory.

RELATED APPLICATIONS

This Application is a Continuation-In-Part of commonly owned U.S. patent application Ser. No. 10/411,168, filed Apr. 9, 2003 now U.S. Pat. No. 7,636,815, entitled “A System and Method for Handling Direct Memory Accesses” to Klaiber et al., which is hereby incorporated herein by reference in its entirety.

Commonly owned U.S. patent application Ser. No. 11/102,289, filed Apr. 7, 2005, entitled “Coherence Memory” to Rozas, is hereby incorporated herein by reference in its entirety.

FIELD OF THE INVENTION

Embodiments in accordance with the present invention relate to cache coherency in multi-processor computer systems.

BACKGROUND

Shared-memory computer systems comprising multiple caching agents, e.g., processors, typically employ cache coherence protocols in order to implement a memory consistency model such as sequential consistency or total store ordering consistency. Such protocols typically involve “snooping” the caches of other agents, e.g., other processors, prior to a given processor changing the state of one of its own cache lines. This “snooping,” also known as coherence traffic, can be quite onerous for a multi-agent system and impose deleterious loading on cache memory bandwidth among agents of such a multi-agent system.

SUMMARY OF THE INVENTION

Conventional cache coherency protocols operating on conventional computer systems are frequently wasteful in that typically there is little or no conflicting, e.g., mutually exclusive, sharing of data. Consequently, most cache “snoops” do not result in a requirement to change cache lines. Typically even when there is sharing of data among several agents, that sharing is read-only in nature and does not require modification of cache lines. Therefore, systems and methods of coherence decoupling buffers for multi-agent computer systems are highly desired.

Accordingly, a coherence decoupling buffer is disclosed. In accordance with a first embodiment of the present invention, a coherence decoupling buffer is for storing tag information of cache lines evicted from a plurality of cache memories. A coherence decoupling buffer may be free of value information of the plurality of cache memories.

In accordance with another embodiment of the present invention, a coherence decoupling buffer does not contain value information of the plurality of cache memories.

In accordance with still another embodiment of the present invention, a computer system comprises a main memory and a plurality of cache memories. The cache memories comprise a plurality of cache lines and each cache line comprises a tag and corresponding value information. A coherence decoupling buffer is coupled to the main memory and to the plurality of cache memories. The coherence decoupling buffer comprises a plurality of tags of cache lines evicted from the plurality of cache memories.

In accordance with still another embodiment of the present invention, a method of managing coherence among caches is disclosed. It is determined if a tag of a snooped cache line is present in a coherence decoupling buffer. Access to the cache line is granted responsive to a presence of the tag

In accordance with still yet another embodiment of the present invention, a computer system comprises a main memory and a plurality of cache memories. The cache memories comprise a plurality of cache lines and each cache line comprises a tag and corresponding value information. The computer system additionally comprises a coherence memory coupled to the main memory comprising a plurality of tags corresponding to the plurality of cache lines. Further, the computer system comprises a coherence decoupling buffer coupled to the coherence memory and to the plurality of cache memories wherein the coherence decoupling buffer comprises a plurality of tags of cache lines evicted from the plurality of cache memories.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a block diagram of an exemplary caching system, in accordance with embodiments of the present invention.

FIG. 2 illustrates an exemplary method of managing coherence among caches, in accordance with embodiments of the present invention.

FIG. 3 illustrates a caching system comprising a coherence decoupling buffer and a coherence memory, in accordance with embodiments of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In the following detailed description of the present invention, coherence decoupling buffer, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be recognized by one skilled in the art that the present invention may be practiced without these specific details or with equivalents thereof. In other instances, well-known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects of the present invention.

Coherence Decoupling Buffer

Embodiments in accordance with the present invention are described in the context of design and operation of integrated semiconductors. More particularly, embodiments of the present invention relate to a coherence decoupling buffer. It is appreciated, however, that elements of the present invention may be utilized in other areas of semiconductor design and operation.

The term “cache” is generally understood to refer to or to describe a collection of data or a data structure duplicating values stored elsewhere, for example, duplicating values stored in main memory of a computer system. Once the data are stored in a cache, the data can be used by accessing the copy stored in a cache rather than accessing the original data. Typically, access times to cache memory are much faster than access times to main memory. Consequently, cache accesses are much faster and contribute to increased performance in comparison to accesses to main memory. However, cache memory is typically orders of magnitude more expensive, on a per bit basis, than main memory. Therefore, complex engineering trade-offs are utilized to determine an advantageous amount of cache memory.

A cache memory is generally organized as a group of cache “lines.” A cache line typically comprises a “tag,” e.g., of 32 bits, and a “value,” e.g., of 1024 bits, for example. The value portion of a cache line typically comprises a copy of information stored (or to be stored) in main memory. The tag portion of a cache line generally identifies a mapping of the cache line value to a portion of main memory. For example, the tag generally comprises the main memory address corresponding to the cache line value. It is appreciated that tags often comprise other information related to the cache line in addition to the address.

Due to the performance advantages of caching, most modern processors, including, e.g., microprocessors, comprise caches, for example, instruction and data caches. Many computer systems also utilize multiple caching agents including multiple cached processors and/or non-processor agents, e.g., caching direct memory access (DMA) agents.

Shared-memory multi-agent computer systems typically employ cache coherence protocols in order to implement a memory consistency model such as sequential consistency or total store ordering consistency.

The term “snoop” is generally understood to refer to or to describe a message from an agent, e.g., a CPU, regarding a status of cache lines.

Conventional cache coherency protocols operating on conventional computer systems are frequently wasteful in that typically there is little or no conflicting, mutually exclusive, sharing of data. Consequently, most cache snoops do not result in a requirement to change cache lines. Typically even when there is sharing of data among several agents, that sharing is of a read-only nature that does not require changing cache lines. Therefore, systems and methods of coherence decoupling buffers are highly desired.

One such well-known consistency protocol is known or referred to by the initials of its states, MESI. MESI, or Modified, Exclusive, Shared, Invalid, describes a sequence of states and state transitions applied to information in a cache to ensure the integrity of information stored in other CPU caches and main memory. For example, MESI data can be encoded into two bits stored within a cache tag. Such cache status information is sometimes referred to as cache “permissions.”

A common condition for data in a cache is to be in the “Shared” state. In the shared state, the cache line contents correspond to main memory and may be shared among all agents.

Prior to being modified by an agent, a cache line is typically marked as being “Exclusive” to a particular cache.

If a CPU (or other agent) modifies information in a cache, the modified lines are marked as “Modified.” This indicates that the underlying data, e.g. contained in the main memory, is no longer valid. As other agents learn of this status, e.g., via snooping or inquiry, such agents know not to utilize main memory or their cache copy, if any, corresponding to the modified cache contents.

Responsive to determining that a cache line has been marked modified or exclusive by an agent, other agents typically mark corresponding cache lines as “Invalid,” indicating that their copies of an invalid cache line should not be utilized.

State changes among multiple caches can cause the various agents, e.g., CPUs, to perform numerous operations. For example, responsive to a cache line state change, partially complete operation sequences in a CPU may need to be rolled back, cache lines may need to be evicted, CPUs or other agents may need to suspend main operations in order to search their own caches to determine if such caches contain affected cache lines. Such operations to maintain cache coherency are considered a “necessary evil.” For example, such operations are conventionally required to maintain cache coherency. However, those same operations are deleterious in that the main operation of an agent, e.g., executing software instructions, does not make progress, and in some cases even regresses, while such cache coherency tasks are completed.

It is appreciated that embodiments in accordance with the present invention are well suited to any hierarchical arrangement of caches within a caching agent. For example, caches internal to a caching agent may be inclusive, exclusive or neither.

It is to be appreciated that embodiments in accordance with the present invention are well suited to other cache coherency models.

A computer system comprising multiple caches that utilizes inclusion, e.g., among multiple levels of cache or via a coherence memory, to filter out cache snoops that do not need to be propagated to the included cache(s) still needs to propagate some snoops.

For example, a remote snoop that results in a cache hit and requires a state change will force a snoop to the included cache(s). For example, a shared access to a cache line that is marked exclusive and dirty, or an exclusive and dirty access to a shared cache line, will force a snoop. It is generally desirable for such snoops to take place in a timely manner as the remote (snooping) agent is waiting for the local agent to perform the required actions, e.g., to invalidate local copies of a cache line.

A second type of required snoop occurs in response to an inclusive cache or coherence memory removing or evicting a cache line, for example because the cache needs space for a newly required line. In contrast to the previous case, however, these snoops can be delayed as no external agent is waiting on them.

In accordance with embodiments of the present invention, a decoupling buffer is added at a layer “above,” e.g., at a hierarchical level higher than, a plurality of included cache(s). Such a decoupling buffer can limit performance degradation due to snoops of this second type, allowing amortization and batching of such snoops.

FIG. 1 illustrates a block diagram of an exemplary caching system 100, in accordance with embodiments of the present invention. Caching system 100 comprises a cache 120 of well-known design. Cache 120 is inclusive of any other caches (not shown) within system 100. Cache 120 comprises two cache lines (read horizontally in FIG. 1), each cache line comprising tag and value information. For example, tag5 135 comprises identification and status information corresponding to value5 145. The identification information is generally a mapping of the cache line to and address in main memory. The status information generally comprises permission bits and other indicators of allowed usage of the cache line. Cache 120 is illustrated as comprising a second cache line, comprising tag6 136 and value6 146.

Caching system 100 further comprises a coherence decoupling buffer 110, in accordance with embodiments of the present invention. Coherence decoupling buffer 110 comprises permission information for cache lines that have been evicted from cache 120. It is appreciated that coherence decoupling buffer 110 may optionally comprise additional information related to a cache line, for example, a full tag and/or the value portion of a cache line, in accordance with embodiments of the present invention.

It is to be appreciated that a coherence decoupling buffer that does not store cache line value information can comprise permission bits for multiple cache lines, thereby making the coherence decoupling buffer effectively larger, e.g., mapping a greater number of evicted cache lines.

Coherence decoupling buffer 110 is illustrated as a first in, first out (FIFO) buffer, although it is to be appreciated that embodiments in accordance with the present invention are well suited to other types of buffers, e.g., a stack or dequeue.

Coherence decoupling buffer 110 is coupled to cache 120. It is to be appreciated that embodiments in accordance with the present invention are well suited to a wide variety of numbers and logical arrangements of caches coupled to coherence decoupling buffer 110. For example, a coherence decoupling buffer is well suited to a caching system in which cache 120 includes, or is inclusive of, multiple caches. Further, a coherence decoupling buffer is well suited to a caching system in which multiple caches are inclusive, exclusive, neither inclusive nor exclusive, or various combinations of such relations.

In response to evicting a cache line from an inclusive cache, e.g., cache 120, the cache line is inserted into coherence decoupling buffer 110. It is appreciated that coherence decoupling buffer 110 is not “inclusive” in a formal caching sense, as coherence decoupling buffer 110 does not contain information currently in cache 120. However, from another perspective, coherence decoupling buffer 110 may be considered inclusive, as it comprises information evicted from an associated inclusive cache.

For example, tag1 131 of coherence decoupling buffer 110 was at one time contained in cache 120. At some point in the past, tag1 131 and its associated value, value1 141, were evicted from cache 120. Similarly, tag2 132, value2 142, tag3 133, value3 143, tag4 134 and value4 144 were all at one time in a cache “below” coherence decoupling buffer 110, e.g., cache 120.

When a remote snoop arrives at the agent comprising coherence decoupling buffer 110, coherence decoupling buffer 110 is examined.

It is appreciated that a remote snoop that hits in the inclusive cache(s) will miss in coherence decoupling buffer 110, as coherence decoupling buffer 110 is filled with cache lines evicted from the inclusive cache. Such a remote snoop hit should be propagated to the inclusive cache(s), e.g., cache 120, in a timely manner. The snoop can either bypass coherence decoupling buffer 110, or it can be inserted in the coherence decoupling buffer 110, subsequently forcing prior pending entries to drain.

A local access that misses in the inclusive cache should look in the coherence decoupling buffer 110. If the access hits within coherence decoupling buffer 110, the entry can be re-inserted into the inclusive cache (assuming that the permissions are compatible) and the entry can be removed from coherence decoupling buffer 110.

It is appreciated that coherence decoupling buffer 110 is well suited to comprising cache line value information Alternatively, coherence decoupling buffer 110 can be limited to holding only permissions.

FIG. 2 illustrates an exemplary method 200 of managing coherence among caches, in accordance with embodiments of the present invention. In optional 210, permissions of an evicted cache line are inserted into a coherence decoupling buffer.

In 220, it is determined if permissions of a snooped cache line are present within the coherence decoupling buffer, for example coherence decoupling buffer 110 of FIG. 1. If the permissions of the snooped cache line are not present in the coherence decoupling buffer, the snoop is a miss of the coherence decoupling buffer. It is appreciated, however, that the snoop is not necessarily a miss of the inclusive cache, as the coherence decoupling buffer does not reflect the present contents of the inclusive cache. Consequently, flow of method 200 continues at 230 and the snoop is propagated to the inclusive cache.

If the permissions of the snooped cache line are present in the coherence decoupling buffer, the snoop is a hit of the coherence decoupling buffer. It is appreciated, however, that the snoop is a miss of the inclusive cache, as the coherence decoupling buffer indicates cache lines that are not, e.g., no longer, in the inclusive cache. Consequently, since the cache line is not present in the inclusive cache, the snoop is of no consequence to contents of the inclusive cache and flow of method passes to 240.

In 230, the snoop is propagated to the inclusive cache for processing in accordance with well-known cache coherency protocols. Ultimately, flow passes to 240.

In 240, access to the cache line is granted.

In this novel manner, neither a cache covered by a coherence decoupling buffer nor an associated caching agent are disturbed by cache snoops for recently evicted cache lines. In many cases, this results in increased performance as many snoops are of a read only variety, and do not require cache changes.

In accordance with embodiments of the present invention, a coherence decoupling buffer can be advantageously combined with a coherence memory. Coherence memory is disclosed in co-pending, commonly owned U.S. patent application Ser. No. 11/102,289, filed Apr. 7, 2005, entitled “Coherence Memory” to Rozas, incorporated herein by reference in its entirety.

FIG. 3 illustrates a caching system 300 comprising a coherence decoupling buffer and a coherence memory, in accordance with embodiments of the present invention.

Coherence memory 310 is generally at the top of a caching agent structural hierarchy. Coherence memory is generally coupled to a main memory and other caching agents. Cache 330 is of well-known cache design and operation. Coherence decoupling buffer is coupled between cache 330 and coherence memory 310.

Coherence memory 310 comprises tag information for all included cache(s), e.g., for cache 330. Consequently, coherence memory 310 comprises tag5 135 and tag6 136, corresponding to the contents of cache 330.

As described previously with respect to FIG. 2, coherence decoupling buffer 320 comprises tag information of cache lines that have been evicted from inclusive cache(s), e.g., from cache 330. Coherence decoupling buffer 320 comprises tag1 131, tag2 132, tag3 133 and tag4 134.

In accordance with an embodiment of the present invention, this novel coupling of a coherence memory with a coherence decoupling buffer can result in advantageously increased cache performance, as read-only snoops to cache lines contained within the included cache(s) are filtered by a coherence memory. Further snoops to an additional set of cache lines that are known not to be within the included cache(s), e.g., have been evicted from such caches, are filtered by a coherence decoupling buffer. Such filtered or blocked snoops do not degrade the main performance of the caching agent, as such snoops generally do in the absence of embodiments in accordance with the present invention.

Embodiments in accordance with the present invention, coherence decoupling buffer, are thus described. While the present invention has been described in particular embodiments, it should be appreciated that the present invention should not be construed as limited by such embodiments, but rather construed according to the below claims. 

What is claimed is:
 1. A cache system comprising: a cache memory including a plurality of cache lines, wherein the cache memory is configured to receive a local access; and a coherence decoupling buffer configured to store at least a portion of a cache line evicted from the cache memory and configured to receive a snoop, wherein if the snoop causes a miss, the snoop is propagated to the cache memory, wherein if the local access causes a cache miss in the cache memory, the local access is propagated to the coherence decoupling buffer, wherein responsive to the local access being propagated from the cache memory to the coherence decoupling buffer, if the local access causes a hit in the coherence decoupling buffer, an entry of the coherence decoupling buffer is re-inserted from the coherence decoupling buffer into the cache memory and removed from the coherence decoupling buffer.
 2. The system of claim 1 wherein the coherence decoupling buffer comprises a capacity that is of substantially less capacity than a total capacity of the cache memory.
 3. The system of claim 1 wherein the coherence decoupling buffer is configured to be free of value information of the cache memory.
 4. The system of claim 1 wherein the cache memory is within a single caching agent.
 5. A method comprising: determining if a tag of a snooped cache line is present in a coherence decoupling buffer coupled to a cache, wherein the cache includes a plurality of cache lines, wherein the cache is configured to receive a local access, wherein the coherence decoupling buffer is configured to store at least a portion of a cache line evicted from the cache and is configured to receive a snoop, wherein if the snoop causes a miss, the snoop is propagated to the cache, wherein if the local access causes a cache miss in the cache, the local access is propagated to the coherence decoupling buffer, wherein responsive to the local access being propagated from the cache to the coherence decoupling buffer, if the local access causes a hit in the coherence decoupling buffer, an entry of the coherence decoupling buffer is re-inserted from the coherence decoupling buffer into the cache and removed from the coherence decoupling buffer; and granting, by the coherence decoupling buffer, access to the cache line responsive to a presence of the tag.
 6. The method of claim 5 further comprising propagating the snoop to the cache responsive to an absence of the tag.
 7. The method of claim 6 further comprising inserting permissions of an evicted cache line into the coherence decoupling buffer.
 8. The method of claim 7 further comprising granting access to the evicted cache line.
 9. A computer system comprising: a main memory; a cache memory including a plurality of cache lines, wherein the cache memory is configured to receive a local access; and a coherence decoupling buffer coupled to the main memory and to the cache memory, wherein the coherence decoupling buffer is configured to store at least a portion of a cache line evicted from the cache memory and is configured to receive a snoop, wherein if the snoop causes a miss, the snoop is propagated to the cache memory, wherein if the local access causes a cache miss in the cache memory, the local access is propagated to the coherence decoupling buffer, wherein responsive to the local access being propagated from the cache memory to the coherence decoupling buffer, if the local access causes a hit in the coherence decoupling buffer, an entry of the coherence decoupling buffer is re-inserted from the coherence decoupling buffer into the cache memory and removed from the coherence decoupling buffer.
 10. The computer system of claim 9 wherein the coherence decoupling buffer has a capacity that is of substantially less capacity than a total capacity of the cache memory.
 11. The computer system of claim 9 wherein the coherence decoupling buffer comprises a FIFO buffer. 